package com.gamiao.cypalproject.server;

import org.apache.log4j.Logger;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.gamiao.cypalproject.client.SyncServlet;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class SyncServletImpl extends RemoteServiceServlet implements
		SyncServlet {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger
			.getLogger(SyncServletImpl.class);

	public String[] getComment(int clickTimes, String comment) {
		logger.debug("Get client comment is:" + comment);
		Date now = new Date();
		SimpleDateFormat timeFormat = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm:ss.SSS");
		logger.debug("Sends server time is:" + timeFormat.format(now));
		String[] returnStrings = { String.valueOf(clickTimes), comment,
				timeFormat.format(now) };

		if (logger.isDebugEnabled()) {
			logger.debug("getComment(int, String) - end"); //$NON-NLS-1$
		}
		return returnStrings;
	}
}
